package com.cn.study0014.test009;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName CalTest.java
 * @Description
 * @createTime 2023年05月18日 17:15:00
 */
public class CalTest {
    public static void main(String[] args) {
        Calculator c=new Calculator();
        Scanner sc= new Scanner(System.in);
        System.out.println("请输入第一个数");
        int i=sc.nextInt();
        System.out.println("请输入第二个数");
        int j=sc.nextInt();
        System.out.println("请输入操作(+,-,*,/)：");
        String string = sc.next();
        switch (string){
            case "+":
                System.out.println(i+string+j+"="+c.add(i,j));
                break;
            case "/":
                System.out.println(i+string+j+"="+c.except(i,j));
                break;
            case "*":
                System.out.println(i+string+j+"="+c.mul(i, j));
                break;
            case "-":
                System.out.println(i+string+j+"="+c.red(i, j));
                break;
            default:
                System.out.println("输入错误！");
        }
    }
}
